#include <bits/stdc++.h>
using namespace std;
long long a[100005], sum[100005];
int main()
{
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    long long n, maxn = 0;
    cin >> n;
    for (long long i = 1; i <= n; i++)
    {
        long long x;
        cin >> x;
        a[x]++;
        maxn = max(maxn, x);
    }
    sum[1] = a[1];
    long long cnt = 0;
    for (long long i = 2; i <= maxn; i++)
    {
        cnt += min(a[i], sum[i - 1]);
        sum[i - 1] = max(0, sum[i - 1] - a[i]);
        sum[i] = sum[i - 1] + a[i];
    }
    cout << n - cnt << endl;
    return 0;
}